﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraGrid.Columns;
using DevExpress.Data.Filtering;

namespace RemoteImaging.LicensePlate
{
    public partial class FormTest : Form
    {
        public FormTest()
        {
            InitializeComponent();

            xpInstantFeedbackSource1.ResolveSession += new EventHandler<DevExpress.Xpo.ResolveSessionEventArgs>(xpInstantFeedbackSource1_ResolveSession);
        }

        void xpInstantFeedbackSource1_ResolveSession(object sender, DevExpress.Xpo.ResolveSessionEventArgs e)
        {
            var session = session1;
            e.Session = session1;
        }

        private void gridView1_CustomFilterDialog(object sender, DevExpress.XtraGrid.Views.Grid.CustomFilterDialogEventArgs e)
        {
            if (e.Column.FieldName == "CaptureTime")
            {
                //using (var filter = new Controls.TimeRangeFilter())
                //{
                //    if (filter.ShowDialog(this) == DialogResult.OK)
                //    {
                //        e.FilterInfo =
                //        new ColumnFilterInfo(ColumnFilterType.Custom,
                //            null,
                //            CriteriaOperator.Parse("CaptureTime >= ? and CaptureTime < ?", filter.from.EditValue, filter.to.EditValue), 
                //            null);
                //    };

                //    e.Handled = true;
                //}

            }
        }


    }
}
